package cn.fboost.mtos.mapper;

import cn.fboost.mtos.dto.request.PageRequest;
import cn.fboost.mtos.entity.ProductSale;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface ProductSaleMapper {
    ProductSale findByProductIdAndDate(@Param("productId") int productId, @Param("date") Date date);
    List<ProductSale> findByProductId(@Param("productId") int productId,
                                      @Param("pagination") PageRequest.PageOffset pagination);

    void incrSales(@Param("productId") int productId, @Param("quantity") int quantity, @Param("date") Date date);
}
